package zack.project.domain.trade.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author A1793
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum NotifyTaskCategoryEnumVO {

    TRADE_SETTLEMENT("trade_settlement","交易结算"),
    TRADE_UNPAID2REFUND("trade_unpaid2refund","交易退单-未支付&未成团"),
    TRADE_PAID2REFUND("trade_paid2refund","交易退单-已支付&未成团"),
    TRADE_PAID_TEAM2REFUND("trade_paid_team2refund","交易退单-已支付&已成团");


    String code;
    String info;

    public static NotifyTaskCategoryEnumVO getByCode(String code){
        for(NotifyTaskCategoryEnumVO vo : NotifyTaskCategoryEnumVO.values()){
            if(vo.getCode().equals(code)){
                return vo;
            }
        }
        throw new RuntimeException("任务通知类型枚举值不存在: " + code);
    }
}
